public with sharing class ControllerForConvertToCase {
    
   
    public PageReference AutoCopyFn(){           
      
      // get param : Weibo Conversationid  ApexPages.currentPage().getParameters().get('Weibo ConversationID');
      
        String GetParam = Apexpages.currentPage().getParameters().get('WeiboConversationId');
        
        Weibo_Conversation__c WeiboConversation = [SELECT Status__c,Content__c FROM Weibo_Conversation__c WHERE id =: GetParam ]; // Where ID=:Weibo ConversationID

        
        
        // set co fields
        Case co = new case();
        co.Status = WeiboConversation.Status__c;
        co.Origin ='Phone';
        co.Description = WeiboConversation .Content__c;
      
      
                 
        /*co.Address__c = Weibo Conversatio    n.Address__c;
        co.Brand__c = Weibo Conversation.Car_Brand__c;
        co.Car_Type__c = Weibo Conversation.Car_Type__c;
        co.Car_Unit_Price__c = Weibo Conversation.Car_Unit_Price__c;
        co.City__c = Weibo Conversation.City__c;
        co.Date_Of_Birth__c = Weibo Conversation.Date_Of_Birth__c;
        co.District__c = Weibo Conversation.District__c;
        co.Mobile_Phone__c = Weibo Conversation.MobilePhone;
        co.Gender__c = Weibo Conversation.Gender__c;
        co.Email__c = Weibo Conversation.Email;
        co.Fax__c = Weibo Conversation.Fax;
        co.Name = Weibo Conversation.Name;
        co.Phone__c = Weibo Conversation.Phone;
        co.Province__c = Weibo Conversation.Province__c;*/
        insert co;
        
        //Weibo_Conversation__c.Rating = 'Closed';
        //update Weibo Conversation;
        
        PageReference pageGoto= new Pagereference('/'+co.Id);
        
        return pageGoto;
    }
    
}